<script>
    const n = uni.getUpdateManager();
    export default {
        data() {
            return {};
        },
        onLaunch: function () {},
        onShow: function (o) {
            console.log(o);
            if (1154 == o.scene) {
                uni.showModal({
                    title: '提示',
                    content: '请点击下方“前往小程序”体验完整功能',
                    showCancel: false,
                    cancelText: '知道了',
                    success: () => {}
                });
            }
            if (1155 == o.scene && o.query.path) {
                uni.switchTab({
                    url: 'pages/' + o.query.path + '/index'
                });
            }
            n.onCheckForUpdate(function (n) {
                console.log(n.hasUpdate);
            });
            n.onUpdateReady(function (o) {
                uni.showModal({
                    title: '更新提示',
                    content: '新版本已经准备好，是否重启应用？',
                    success(o) {
                        if (o.confirm) {
                            n.applyUpdate();
                        }
                    }
                });
            });
            n.onUpdateFailed(function (n) {});
        },
        onHide: function () {},
        onError: function (n) {},
        globalData: {}
};

</script>
<style>
 @import './app.css';
</style>
